package com.hxit.huaxiamelongarden.controller;

import com.hxit.huaxiamelongarden.utils.CaptchaUtil;
import com.hxit.huaxiamelongarden.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CaptchaController
 * @Author 12694
 * @Date 2025/1/21 12:38
 * @Version 1.0
 **/
@RestController
@Slf4j
@RequestMapping("/captcha")
public class CaptchaController {
    @GetMapping
    public Result sendCaptcha(){
        String str = CaptchaUtil.generateCaptchaText(5);
        log.info("验证码为：{}",str);
        return Result.success(str);
    }
}
